home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
ptv1n4.arc
/
GET.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1990-09-13
|
835b
|
27 lines
{ get.pas -- Retrieve a string from the passive TSR's buffer }
program get;
uses crt, utransfer;
var
s : string; { String to receive transfer }
n : word; { Number of bytes transferred }
bufSize : word; { Returned by Status }
typeCode : byte; { Returned by Status }
errorCode : byte; { Returned by Status }
begin
Status( bufSize, typeCode, errorCode );
if typeCode <> 1 then
begin
writeln( 'Data is not a string' );
halt( 1 )
end; { if }
fillchar( s, sizeof(s), 0 ); { Erase any leftovers in s }
n := GetBlock( @s, sizeof(s) ); { Get data from TSR }
if transferError <> 0 then
begin
writeln( 'ERROR: Code #', transferError );
halt( transferError )
end; { if }
writeln( 'string = ', s ) { Display results }
end.